/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.kungkhies.common.services.kungkhie.validate.knodes;

import com.kungkhies.xml.schema.kungkhie.KungkhieType;
import com.kungkhies.xml.schema.kungkhie.KNodeListType;
import com.kungkhies.xml.schema.kungkhie.KNodeType;
import java.util.HashMap;
import java.util.Map;
import org.springframework.stereotype.Service;

/**
 *
 * @author clayton
 */
@Service("kNodesValidatorService")
public class KnodesValidatorServiceImpl implements KnodesValidatorService
{
    private Map<String, Integer> kNodeIdentifierMap;

    @Override
    public Map<String, Integer> createNodeIdentifierMap(KungkhieType kungkhieType) throws KnodeValidateException
    {
        KNodeListType kNodeList = kungkhieType.getKNodeList();
        KNodeType[] kNodeArray = kNodeList.getKNodeArray();
        kNodeIdentifierMap = new HashMap<String, Integer>();
        
        int i = 0;
        for (KNodeType kNode  : kNodeArray)
        {
            kNodeIdentifierMap.put(kNode.getKNodeID(), i);
            i++;
        }
       
        return kNodeIdentifierMap;
    }

    @Override
    public int[][] createAdjacencyMatrix() throws KnodeValidateException
    {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Map createLevelMap(KungkhieType kungkhieType) throws KnodeValidateException
    {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void validateNodeType(int[][] connectionMatrix) throws KnodeValidateException
    {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public int[][] createIncidenceMatrix(KungkhieType kungkhieType) throws KnodeValidateException
    {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Map createNodeTypeMap(KungkhieType kungkhieType) throws KnodeValidateException
    {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public boolean validateAdjacencyMatrix(int[][] adjacencyMatrix)
    {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public boolean validateIncidenceMatrix(int[][] incidenceMatrix)
    {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public int findStartNode(KungkhieType kungkhieType) throws StartKnodeException
    {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public int findFinishNode(KungkhieType kungkhieType) throws FinishKnodeException
    {
        throw new UnsupportedOperationException("Not supported yet.");
    }

}
